<template name="creator_list_wrapper">
	<div class="steedos-brand-band slds-brand-band_medium slds-template_bottom-magnet creator-list-wrapper">
		<div class="slds-template__container">
			<div class="shadow listViewManager slds-grid slds-grid--vertical filter-list-wraper {{#if isCalendarView}}creator-calendar-wrap {{else}} creator-grid-wrap {{/if}}">
				<div class="slds-page-header--object-home slds-page-header_joined slds-page-header_bleed slds-page-header slds-shrink-none test-headerRegion forceListViewManagerHeader">
					<div class="slds-grid grid-info-actions">
						<div class="slds-col slds-has-flexi-truncate">
							<div class="slds-media slds-no-space slds-grow">
								<div class="slds-media__figure">
									<span class="slds-icon_container">
										<div class="slds-icon crm-header-icon">
											<span class="uiImage">
												{{> steedos_icon class="slds-icon slds-page-header__icon" source="standard-sprite" name=object.icon}}
											</span>
										</div>
									</span>
								</div>
								<div class="slds-media__body">
									<nav>
										<ol class="slds-breadcrumb slds-line-height_reset">
											<li class="slds-breadcrumb__item crm-breadcrumb-item">
												<span>{{_ object.label}}</span>
											</li>
										</ol>
									</nav>
									{{#if sidebarDropdownMenu}}
										{{> Template.dynamic template=sidebarDropdownMenu.template_name}}
									{{else}}
										<h1 class="slds-page-header__title slds-text-color--default slds-p-right--x-small crm-header-title">
											<a class="triggerLink slds-button slds-button--reset slds-type-focus slds-truncate forceListViewPicker" role="button" title="" href="javascript:void(0);" data-toggle="dropdown">
												<div class="triggerLinkTextAndIconWrapper flex">
													<span class="triggerLinkText selectedListView uiOutputText">{{list_view_label list_view}}</span>
													<span class="slds-icon_container slds-icon-utility-down downIcon slds-button__icon forceIcon">
														<span class="lightningPrimitiveIcon">
															{{> steedos_icon class="slds-icon slds-icon-text-default slds-icon--x-small" source="utility-sprite" name="down"}}
														</span>
													</span>
												</div>
											</a>
											<div class="dropdown-menu dropdown-menu-left crm-header-menu" role="menu">
												<ul class="slds-dropdown__list slds-show">
													{{#each list_views}}
													<li class="slds-dropdown__item crm-header-menu-item" role="presentation">
														<a role="option" tabindex="-1" class="list-view-switch" href="{{list_view_url this}}">
															<span>{{list_view_label this}}</span>
															<span class="slds-badge">{{list_view_count this}}</span>
														</a>
													</li>
													{{/each}}
												</ul>
											</div>
										</h1>
									{{/if}}
								</div>
							</div>
						</div>
						<div class="slds-col slds-no-flex slds-grid slds-align-top slds-p-bottom_xx-small">
							{{#if canFollow}}
								{{#if isFollowing}}
								<button class="slds-button slds-button_neutral slds-button_stateful slds-is-selected list-action-follow" aria-live="assertive">
									<span class="slds-text-selected">
									  {{> steedos_icon class="slds-button__icon slds-button__icon_small slds-button__icon_left" source="utility-sprite" name="check"}}
									  {{_ "following"}}
									</span>
									<span class="slds-text-selected-focus">
									  {{> steedos_icon class="slds-button__icon slds-button__icon_small slds-button__icon_left" source="utility-sprite" name="close"}}
									  {{_ "unfollow"}}
									</span>
								  </button>
								{{else}}
								<button class="slds-button slds-button_neutral slds-button_stateful slds-not-selected list-action-follow" aria-live="assertive">
									<span class="slds-text-not-selected">
										{{> steedos_icon class="slds-button__icon slds-button__icon_small slds-button__icon_left" source="utility-sprite" name="add"}}
										{{_ "follow"}}
									</span>
								</button>
								{{/if}}
							
							{{/if}}
							<ul class="slds-button-group slds-m-left--xx-small oneActionsRibbon forceActionsContainer">
								{{#each actions}}
									<li class="slds-button slds-button--neutral slds-truncate list-action-custom list-action-custom-{{this.name}}">
										<a href="javascript:void(0);" title="{{this.label}}" class="">
											<div class="slds-truncate" title="{{this.label}}">{{this.label}}</div>
										</a>
									</li>
								{{/each}}
							</ul>
						</div>
						
					</div>
					{{#unless isCalendarView}}
					<div class="slds-grid">
						<div class="slds-col slds-align-middle">
							<p class="slds-text-body_small tabular_info">{{#if recordsTotalCount}}{{_ "creator_list_item_counts" recordsTotalCount}}{{else}}{{_ "creator_list_item_counts" 0}}{{/if}}</p>
						</div>
						{{#if sidebar.enable_hide}}
							<div class="slds-col slds-no-flex slds-grid slds-align-bottom slds-shrink grid-sidebar-toggle">
								{{> steedos_button className=(btnToggleGridSidebarClass sidebar.hidden)
									iconCategory="utility" iconName="rows" variant="icon" title="显示侧栏"}}
							</div>
						{{/if}}
						<div class="slds-col slds-no-flex slds-grid slds-align-bottom slds-shrink grid-search-div">
							<div>
								<div class="search-in-list slds-m-left_x-small slds-is-relative">
									<div force-list-view-manager-search-bar_list-view-manager-search-bar="" class="slds-form-element">
										<label for="grid-search" class="slds-form-element__label slds-no-flex slds-assistive-text">{{_ "Search"}} {{_ object.label}}</label>
										<div class="slds-form-element__control slds-grow slds-input-has-icon slds-input-has-icon_left-right">
											<input type="search" value="{{search_text}}" id="grid-search" placeholder="{{_ 'Search'}} {{_ object.label}}" name="search-input" class="slds-input">
											<div>
												{{> steedos_icon class="slds-input__icon slds-input__icon_left" source="utility-sprite" name="search"}}
											</div>
											<div class="slds-input__icon-group slds-input__icon-group_right"></div>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="slds-col slds-no-flex slds-grid slds-align-bottom grid-actions">
							<div class="slds-dropdown-trigger slds-dropdown-trigger_click slds-m-left_x-small" aria-expanded="false">
								<div aria-haspopup="true" data-toggle="dropdown">
									{{> steedos_button className="slds-button_icon-more"
										iconCategory="utility" iconName="settings" iconVariant="more" variant="icon" title=(_ "creator_list_view_controls")}}
								</div>
								<div class="dropdown-menu dropdown-menu-right" role="menu">
									<ul class="slds-dropdown__list list-view-controls">
										<li class="slds-dropdown__header" role="separator">
											<span class="slds-text-title--caps">{{_ "creator_list_view_controls"}}</span>
										</li>
										<li class="slds-dropdown__item add-list-view" role="presentation">
											<a href="javascript:void(0);" class="" role="option" tabindex="-1">
												<span>{{_ "creator_list_new_list_view"}}</span>
											</a>
										</li>
										<li class="slds-dropdown__item export-data-grid {{#if isTree}}hidden{{/if}}" role="presentation">
											<a href="javascript:void(0);" class="" role="option" tabindex="-1">
												<span>{{_ "creator_list_export_list_view"}}</span>
											</a>
										</li>
										<li class="slds-dropdown__item copy-list-view {{#if isTree}}hidden{{/if}}" role="presentation">
											<a href="javascript:void(0);" class="" role="option" tabindex="-1">
												<span>{{_ "creator_list_copy_list_view"}}</span>
											</a>
										</li>
										{{#if is_custom_list_view}}
											{{#if is_view_owner}}
												<li class="slds-dropdown__item edit-list-view" role="presentation">
													<a href="javascript:void(0);" title="{{_ "creator_list_edit"}}" class="" role="option" tabindex="-1">
														<span>{{_ "creator_list_edit"}}</span>
													</a>
												</li>
												<li class="slds-dropdown__item select-fields-to-display hidden" role="presentation">
													<a href="javascript:void(0);" title="{{_ "creator_list_select_fields"}}" class="" role="option" tabindex="-1">
														<span>{{_ "creator_list_select_fields"}}</span>
													</a>
												</li>
												<li class="slds-dropdown__item delete-list-view" role="presentation">
													<a href="javascript:void(0);" title="{{_ "creator_list_delete_list_view"}}" class="" role="option" tabindex="-1">
														<span>{{_ "creator_list_delete_list_view"}}</span>
													</a>
												</li>
											{{/if}}
										{{/if}}
										<li class="slds-dropdown__item reset-column-width hidden" role="presentation">
											<a href="javascript:void(0);" class="" role="option" tabindex="-1">
												<span>{{_ "reset_column_width"}}</span>
											</a>
										</li>
									</ul>
								</div>
							</div>
							<div class="slds-dropdown-trigger slds-dropdown-trigger_click slds-m-left_xx-small hide">
								{{> steedos_button className="slds-button_icon-more" disabled=true
									iconCategory="utility" iconName="table" iconVariant="more" variant="icon" title=(_ "creator_change_view")}}
							</div>
							{{> steedos_button className="slds-m-left_xx-small slds-button_icon-border-filled hide" disabled=true
								iconCategory="utility" iconName="edit" variant="icon" title=(_ "creator_edit_list")}}
							{{#if isRefreshable}}
								{{> steedos_button className="slds-m-left_xx-small slds-button_icon-border-filled btn-refresh" 
									iconCategory="utility" iconName="refresh" variant="icon" title=(_ "creator_refresh")}}
							{{/if}}
							<!-- <div class="slds-button-group" role="group">
								{{> steedos_button className="slds-m-left_xx-small slds-button_icon-border-filled btn-refresh" disabled=true 
									iconCategory="utility" iconName="chart" variant="icon" title=(_ "creator_charts")}}
							</div> -->
							{{> steedos_button className=(btnToggleFilterClass isFiltering)
								iconCategory="utility" iconName="filterList" variant="icon" title=(_ "creator_filters")}}
						</div>
					</div>
					{{/unless}}
				</div>
				<div class="weui-flex" style="height: 100%;">
					<div style="overflow: hidden;" class="slds-grid table-grid-content weui-flex__item">
						<div class="slds-col slds-no-space {{#if sidebar}}sidebar-open{{/if}}">
						{{#if list_view_visible}}
							{{#if isCalendarView}}
								<div class="tale-content list-table-container td-cell-wrap list-table-main">
									{{> Template.dynamic template='creator_calendarNew' data=list_data}}
								</div>
							{{else}}
								{{#if sidebar}}
									<div class="slds-table tale-content list-table-container td-cell-wrap list-table-sidebar {{#if sidebar.hidden}}slds-hide{{/if}}">
										{{> Template.dynamic template=sidebar.template_name}}
									</div>
								{{/if}}
								<div class="slds-table tale-content list-table-container td-cell-wrap list-table-main">
									{{#if showAsGrid}}
										{{> Template.dynamic template=list_template data=list_data}}
									{{else}}
										{{> list options=list_data}}
									{{/if}}
								</div>
							{{/if}}
						{{/if}}
						</div>
						<div class="slds-grid slds-no-flex slds-hide filter-list-container">
							<div class="filter-list slds-grid slds-grid_vertical">
								<div class="slds-form slds-form_stacked slds-grow slds-scrollable_y slds-grid slds-grid_vertical">
									<div class="slds-filters">
										<div class="slds-filters__header slds-grid slds-has-divider_bottom-space">
											{{#unless is_filter_changed}}
												<h2 class="slds-align-middle slds-text-heading_small">{{_ "creator_list_filter"}}</h2>
												{{> steedos_button className="slds-col_bump-left slds-button_icon slds-button_icon-small close-filter-panel" title=(_ "creator_filter_close_filter_panel")
													iconCategory="utility" iconName="forward" iconClassName="slds-button__icon_hint" variant="icon"}}
											{{else}}
												<button class="slds-button slds-button_neutral cancel-change">{{_ "creator_list_filter_cancel"}}</button>
												<!-- <button class="slds-button slds-button_neutral filters-save-as">{{_ "creator_list_filter_save_as"}}</button> -->
												<button class="slds-button slds-button_brand save-change">{{_ "creator_list_filter_save"}}</button>
											{{/unless}}
										</div>
										<div class="vert-scroller">
											{{> filter_option_list}}
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="filter-option-box">
			</div>
		</div>
	</div>
	{{#CreatorAfModal formId="addListView" class="btn btn-primary btn-add-list-view hidden" collection="Creator.Collections.object_listviews" meteormethod="af_insert" fields=object_listviews_fields operation="insert" dialogClass="modal-lg modal-body-zoom.includes" buttonContent=insertButtonContent collectionName=object_listviews.label useOdataApi=true}} {{_ "Create"}} {{/CreatorAfModal}}
	{{#CreatorAfModal formId="editListView" class="btn btn-primary btn-edit-list-view hidden" collection="Creator.Collections.object_listviews" doc=current_list_view operation="update" meteormethod="af_update" fields="name,label,filter_scope,columns,filter_fields,sort,shared,type,scrolling_mode,show_count,mobile_columns" dialogClass="modal-lg modal-body-zoom.includes" buttonContent=updateButtonContent collectionName=object_listviews.label useOdataApi=true}} {{_ "Create"}} {{/CreatorAfModal}}
	{{#CreatorAfModal class="btn btn-primary btn-delete-list-view hidden" collection="Creator.Collections.object_listviews" operation="remove" dialogClass="modal-lg modal-body-zoom.includes" buttonContent=insertButtonContent collectionName=object_listviews.label onSuccess=delete_on_success useOdataApi=true}} {{_ "Delete"}} {{/CreatorAfModal}}
</template>